package com.mail.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mail.pojo.EmailConfig;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface EmailConfigMapper extends BaseMapper<EmailConfig> {
    /**
     * 根据邮箱查询配置信息
     */
    @Select("select id from email_config where account_email = #{emailConfig}")
    Long queryByAccountEmail(@Param("emailConfig") String emailConfig);

    /**
     * 根据账号查询配置
     */
    @Select("select email_key,email_port,send_host from email_config where account_email = #{accountEmail}")
    EmailConfig queryConfigByAccount(@Param("accountEmail") String accountEmail);
}
